﻿using Microsoft.Practices.Unity;
using YmtSystem.CrossCutting;
using YmtAuth.Domain.Repository;
using YmtAuth.Repository.YmtAuthDomainRepository;
using YmtAuth.Repository.Register;
using YmtAuth.Domain.Repository.EventRepository;
using YmtAuth.Repository.MySQL;

namespace YmtAuth.Repository
{
    public class InitServiceTask : RegisterServiceBootstrapperTask
    {
        public InitServiceTask(IUnityContainer container) : base(container) { }

        public override TaskContinuation Execute()
        {

            RegisterMetaDataTask.ExecuteTask();

            //container.RegisterTypeAsSingleton<IUuserCredentialMappingTable, UuserCredentialMappingTable>();
            container.RegisterType<IUserLoginBillsRepository, UserLoginBillsRepository>();
            container.RegisterTypeAsSingleton<IYmtUserLoginHistoryRepository, YmtUserLoginHistoryRepository>();
            //container.RegisterType<IUserRegisterEventRepository, UserRegisterEventRepository>();
            container.RegisterType<IUserTokenRepository, UserTokenRepository>();
            container.RegisterTypeAsSingleton<ILoginIdUpdateEventRepository, LoginIdUpdateEventRepository>();
            container.RegisterTypeAsSingleton<IYmtUserPasswordChangeEventRepository, YmtUserPasswordChangeEventRepository>();
            container.RegisterTypeAsSingleton<IYmatouBlacklistUserRepository, YmatouBlacklistUserRepository>();

            //container.RegisterTypeAsSingleton<IIpRequestHistoryRepository, IpRequestHistoryRepository>();
            container.RegisterTypeAsSingleton<IBlackListRepository, BulackListRepository>();
            container.RegisterTypeAsSingleton<IAuthConfigurationRepository, AuthConfigurationRepository>();
            container.RegisterTypeAsSingleton<IAuthSafeVerifyLogRepository, AuthSafeVerifyLogRepository>();
            container.RegisterType<ISecurityQuestionRepository, SecurityQuestionRepository>();
            container.RegisterType<IDualSecurityRepository, DualSecurityRepository>();
            container.RegisterTypeAsSingleton<IAuthSafeManageLogRepository, AuthSafeManageLogRepository>();
            container.RegisterType<ISellerOnlineStatusRepository, SellerOnlineStatusRepository>();
            return TaskContinuation.Continue;
        }
    }
}
